module.exports = app => {
  const { router, controller } = app;

  //登录
  router.post('/api/login', controller.login.login)

  //注册
  router.post('/api/register', controller.login.register)

  //往数据库添加数据
  router.get('/api/mock', controller.home.mock)

  //获取热点数据
  router.post('/api/getHotList', controller.home.getHotList)

  //获取话题数据
  router.post('/api/getTopicList', controller.home.getTopicList)

  //获取生活数据
  router.post('/api/getLiveList', controller.home.getLiveList)

  //获取睡眠数据
  router.post('/api/getSleepList', controller.home.getSleepList)

  //获取男性数据
  router.post('/api/getManList', controller.home.getManList)

  //热点搜索
  router.post('/api/getHotSearch', controller.home.getHotSearch)

  //话题搜索
  router.post('/api/getTopicSearch', controller.home.getTopicSearch)

  //生活搜索
  router.post('/api/getLiveSearch', controller.home.getLiveSearch)

  //睡眠搜索
  router.post('/api/getSleepSearch', controller.home.getSleepSearch)

  //男性搜索
  router.post('/api/getManSearch', controller.home.getManSearch)

  //获取商城数据
  router.post('/api/getShopList', controller.home.getShopList)

  //商城详情页
  router.post('/api/getShopDetail', controller.home.getShopDetail)

  //获取商城数据
  router.post('/api/getDepartment', controller.home.getDepartment)

  //加入购物车
  router.post('/api/getCarShop', controller.home.getCarShop)

  //获取购物车数据
  router.post('/api/getCarList', controller.home.getCarList)

  //删除购物车
  router.post('/api/deleteCarList', controller.home.deleteCarList)

  //商品列表加入购物车
  router.post('/api/getCarDepart', controller.home.getCarDepart)

  //商品列表搜索
  router.post('/api/getDepartSearch', controller.home.getDepartSearch)

  //商城搜索
  router.post('/api/getShopSearch', controller.home.getShopSearch)

  //支付
  router.get('/api/pay', controller.pay.alipay);
};
